'''
pickle模块:
    作用: 数据的持久化
    往硬盘里存数据
    优势： 保持数据类型不变

'''

import pickle

# 写入数据

# data_01 = { "name": "张三", "age": 18}
# with open(r"D:\PycharmPythonProject\project1110\filetest\data.txt", mode="wb") as fobj:
#     pickle.dump(data_01, fobj)

# 读取数据
with open(r"D:\PycharmPythonProject\project1110\filetest\data.txt", mode="rb") as fobj:
    data_02 = pickle.load(fobj)
    print(data_02)
    print(type(data_02))